package demo;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

import Decoder.BASE64Decoder;

public class Base64 {
	public static void main(String[] args) {
		String str = "iVBORw0KGgoAAAANSUhEUgAAAFcAAABXCAMAAABGFileAAAAGXRFWHRTb2Z0d2F"
				+ "yZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3FpVFh0WE1MOmNvbS5hZG9iZS54bXAAAA"
				+ "AAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzl"
				+ "kIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFk"
				+ "b2JlIFhNUCBDb3JlIDUuNi1jMTM4IDc5LjE1OTgyNCwgMjAxNi8wOS8xNC0wMTowOTowM"
				+ "SAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOT"
				+ "k5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ"
				+ "9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHht"
				+ "bG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY"
				+ "2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE"
				+ "1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo5Njg4MjI4Ni0yMDlkLWYyNGEtYmNj"
				+ "Ni01MmUzZjI3MTNlOGMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NTQ0RDFCRDVDO"
				+ "UE5MTFFN0I3NUNCOERFMTMzODIyMEUiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NT"
				+ "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rsmer5Lpi0g0hnT87vl5bzift+O9YzSmi164yvFEKkiWx3b1HxTvM8aFxwoRTyFs1sUFD"
				+ "w0BFx0Ndzixl0iGy625i0SVSzjVRzDP+//3T86slmj9NxjEmn0NRyjRKq3Myu1f2/Pdv2hZk0"
				+ "iV2xIiY0qZYtW9QwitW0TAimUMPlS8xv1f///8fmEVx1w912Qt22gp32glazShWzCtEwz44vk"
				+ "uPzp5Yyz8Znx9Gwmfo+OI8wVFOyRye4ZWb3q37/vpm0YOEyZR/1oaA1ZZg0CxVyjILmSi97oR"
				+ "Awjpj1B/M8LBVyywkqyABii1303dVzi9f0Cih35RJxj9BwUz9/v182ErS8cAjnEQephyE3hxx3"
				+ "BV52h50xXmU3ZA2vlAIkigAhAwElw4EkxxXv2H9/P96zo+x5q9HxS+e4KIzu08xvEg/wUSS3m3"
				+ "////m3NVMAAABAHRSTlP//////////////////////////////////////////////////////"
				+ "///////////////////////////////////////////////////////////////////////////"
				+ "/////////////////////////////////////////////////////////////////////////////"
				+ "////////////////////////////////////////////////////////////////////////////"
				+ "///////8AU/cHJQAABrJJREFUeNqs2XlYFGUcwPFBDgEHGSQXBhCSTRZxBBc5BQFR8EwQcEGOXV"
				+ "JWywMQVPAAUlBRDBRByQtTzGPVUdcDFRctvIIoIss0swwJIkvssoNsdlj2mHlnd3bxq/+s7u/z"
				+ "zDO8zAm90JlVVnVkooN1l7e3d5e1Q2Lk7Cwr3UOQ9v9Onhbp4D2elvXh41b9cI9PB5iKvKdXSw"
				+ "xy/b6yJsYXjmeuK9JZb9f5sPdCFiVm6eUmRw5dOJRdiVbs3equD1l3zXs2S9d5+gf65ZDFxp12"
				+ "Tf+qdbuREw0pUYcrcbA1oIm2edbJ2ly+xcSrtobl5MfsWjnZXjWwvKtPnJlcvlNef3rix+BamP"
				+ "TLNXFKBroOkEk/swC56f1kifE8L7rbYQK9hN6mun6vgIMqgo3oBVcwfd2Z4lqAv1dhVLHMgt6y"
				+ "TKNg8MA7mu7Xw4BlB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wG2LeudvTIZeLAe59yazXA+WaRmwsvoDCvcN4rz5yw1690rZbu+kDLHKxTuLFpHz6w"
				+ "h39I2D9EqXs3S5QhUrXxNtNXLuOeFKD4Iq/d3DTnGKW9PClyeVZymvqqr3FN0+yaOwG9aI2BPy6Sb59"
				+ "dm3poBqSu/W9V7rDBK7kaXJ/5AJ6siLlZbyKGE3gmi4aGdRjanpcvK6bzTI7akpwgSku/9ZFFmGKk4K"
				+ "eYSEhThM7bKgxrTnee/1b4BpD72pNRvc/pCPr8Row0KufLXw3aJgepcP1DyW9rp/TwXVE124ldGVMbp"
				+ "o55AViuv1qqmvg4p+z5DtRS4LRH33Q58zuBIDthdGa5X3WT5DQEUHtBuwvTA+WHW/6auvq2X/ctXvjx/"
				+ "fpBcdIOm9yGNwZSAXx33U7+fn0lmX6ADycvGWXi6aqvn8oeCmC7V/Py6YwOVyI8S04co08hyKoHTWjfJ"
				+ "cw+cpzX3qsuEuJhQS9yfUBJXk2R5HaHsBHUx9vjP6Hxe6HPbWCRTWI3QX/XmU725a/7iEbdMHVqwFyvO"
				+ "zgt2AwrahrGE0Avhcrt1sOKCw4egJlmyaD/g5omUjCL4yHGcFo+RxAfg81adxIKB58wQsYBQRMT//rTJj"
				+ "gnFdrJtI2/NqaQwY1rXe0EI7Hc/XfYHwFa0wju5fo/N9wHYQPPCKlvWGwhfYvL8QxegF42hKLsv3LdvPg"
				+ "OCBwIWM4qns3w/Z+QJh5ARd3S/S632W6M4ZnQsZJ9Rcvd+/2fnuAK03XImigvMig94XSufG7ACvNxzHEa"
				+ "5HleHvNy3DfQvOaMDEgROHy1futevXe1PyqBH+6Z0Ys8Yd8hrNPvszda9I99D/AgwAisUr0M48I88AAAAA"
				+ "SUVORK5CYII=";
		System.out.println(str.length());
		
		BASE64Decoder decoder = new BASE64Decoder();
		try {
			byte[] b = decoder.decodeBuffer(str);
			
			for(int i=0;i<b.length;++i) {
				if(b[i] < 0) {
					b[i] += 256;
				}
			}
			OutputStream out = new FileOutputStream("/Users/zpon/Desktop/111.png");
			out.write(b);
			out.flush();
			out.close();
			
		} catch (IOException e) {
			e.printStackTrace();
		}
		
	}
}
